<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    let arr =Array.of(1,2,1,3);
    console.log(arr.findldex(item =>item>2));//1

    //数组空位处理为undefined
    console.log([,1].findldex(n => true));//10

</script>
</html>